package com.mz.mattress.admin;

import com.mz.mattress.api.config.UniqueNameGenerator;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.env.Environment;

@Slf4j
@SpringBootApplication(exclude = {SecurityAutoConfiguration.class})
@ComponentScan(nameGenerator = UniqueNameGenerator.class, basePackages = {"com.mz.mattress"})
public class AdminApplication {

    public static void main(String[] args) {

        ConfigurableApplicationContext context = SpringApplication.run(AdminApplication.class, args);
        Environment environment = context.getBean(Environment.class);

        log.info("ActiveProfile=" + environment.getActiveProfiles()[0]);
        log.info("http://localhost:" + environment.getProperty("local.server.port"));

//        Object redisTemplate = context.getBean("redisTemplate");
//        System.out.println(redisTemplate);

//        ArticleMapper bean = context.getBean(ArticleMapper.class);
//        bean.updateSort("hot",1,2);
//        System.out.println("dd");

    }

}



